package com.ssm.mapper;

import com.ssm.pojo.TbUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 咕唧
 * @Date 2022/5/22 19:42
 * @Version 1.0
 */

public interface UserMapper {
    @Select("select * from tb_user where id=#{id}")
    TbUser findById(Long id);

    @Select("select * from tb_user where password=#{password}")
    List<TbUser> findAll(String password);

    @Insert("insert into tb_user values(id=#{id},username=#{username},password=#{password},email=#{email},gender=#{gender},flag=#{flag},role=#{role},code=#{code})")
    void addUser(TbUser user);
}
